#!/bin/bash
# Increment counters
function addCounters(){
	local fileCounter=$COUNTERSDIR/$1
	#Total Installs
	local counter=0
	if [ -f ${fileCounter} ]; then
	    counter=`cat ${fileCounter}`
        fi
	counter=$(($counter +1 ));
	echo $counter > ${fileCounter}
}

if [ "$1" != "" ]; then
     if [ "$COUNTERSDIR" == "" ]; then
            WORKDIR="../../../data/stats/develenv"
            COUNTERSDIR=$WORKDIR/counters
            mkdir -p $WORKDIR
            mkdir -p $COUNTERSDIR
     fi
     addCounters $1
fi
